package service.impl;

import java.util.List;

import dao.ISmsDao;
import dao.impl.SmsDaoImpl;
import entity.Course;
import entity.Elective;
import entity.User;
import service.ISmsserivce;


public class SmsserivceImpl  implements ISmsserivce{
	
	ISmsDao sms = new SmsDaoImpl();
	// 学生添加课程
	public int addCourse(Elective elective) throws Exception {
		return sms.addCourse(elective);
	}	
	// 显示学生课程
	public List<Course> selectCourse(User user) throws Exception {
		return sms.selectCourse(user);
	}	
	// 教师添加课程
	public int insertCourse(Course course) throws Exception {
		return sms.insertCourse(course);
	}	
	// 教师显示所有课程
	public List<Course> selectAll() throws Exception {
		return sms.selectAll();
	}	
	// 登录验证
	public  int login(User user) {
		return sms.login(user);
		
	}
	// 注册
	@Override
	public int addUser(User user) {
		return sms.addUser(user);
	}
	// 根据编号进行查询
	@Override
	public List<Course> selectCourseById(Course course) throws Exception {
		return sms.selectCourseById(course);
	}
	// 根据编号进行删除
	@Override
	public int deleteCourseById(Course course) throws Exception {
		return sms.deleteCourseById(course);
	}

	@Override
	public int deleteStudentCourseById(Elective elective) throws Exception {
		return sms.deleteStudentCourseById(elective);
	}
}
